<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:composition template="/home.xhtml">
			<ui:define name="pageTitle">Cadastro Departamento</ui:define>
			<ui:define name="pageHeader">Cadastro de Departamento</ui:define>
			<ui:define name="body">
				<h:form id="Form">
				<h:messages />
				<h:panelGrid columns="2">
					<h:outputLabel value="Descrição" />
					<h:inputText value="#{cadastrarDepartamentoBB.dp.descricao}" required="true" />
					
					<h:outputLabel value="Valor:" />
					<h:inputText value="#{cadastrarDepartamentoBB.dp.valorTicket}" />
				</h:panelGrid>
				<h:commandButton action="#{cadastrarDepartamentoBB.salvar}" value="Salvar" />
				<h:commandButton value="Voltar" action="principal" />
				</h:form>
				<h:form>
				<h:panelGrid columns="2">
				<div>
					<h:dataTable value="#{cadastrarDepartamentoBB.obterTodos()}" var="dep" border="1" cellpadding="2" cellspacing="0">
						<f:facet name="header"><h3 align="center">Relação de Departamento</h3></f:facet>	
						<h:column>
							<f:facet name="Departamento"></f:facet>
							<h:outputText value="#{dep.descricao}" />
						</h:column>
						<h:column>
							<f:facet name="Valor"></f:facet>
							<h:outputText value="#{dep.valorTicket}" />
						</h:column>
						
					</h:dataTable>
				</div>
				</h:panelGrid>
				</h:form>
			</ui:define>
	</ui:composition>

</html>